package SpLib.Com
{
	import flash.events.Event;
	
	/**
	 * SpLib 标准Event
	 *  
	 */
	public class SpLibEvent extends flash.events.Event
	{	
		/** Obj的一般Event消息推送	*/
		public static const EVENT:String = "SpLibObjEvent";
		
		/** Obj删除时消息广播	*/
		public static const OBJDELTHIS:String = "SpLibObjDelThis";
		
		/** 网络连接失败	*/
		public static const NET_CONNECTFAIL:String = "SpLibSocketConnectFail";
		
		/** 网络连接成功	*/
		public static const NET_CONNECTED:String = "SpLibSocketConnected";
		
		/** RPC调用，返回成功	*/
		public static const RPC_RETOK:String = "SpLibObjRPCRetOk";
		
		/** RPC调用，返回失败	*/
		public static const RPC_RETERR:String = "SpLibObjRPCRetErr";
		
		/** RPC主动回调	*/
		public static const RPC_RECALL:String = "SpLibObjRPCRecall";
		
		
		public var m_sEveName:String = "";
		public var m_Eve:SpLib.Com.EveNode = null;
		
		public var m_Agv:Array = new Array;
		
		public var m_nErrFlag:int = 0;
		public var m_sErrMsg:String = "";
		public var m_ExtAgv:Array = new Array;
		
		public function SpLibEvent(name:String,eve:String = "",agv:Array = null)
		{
			super(name);
			
			m_sEveName = name;
			
			m_Eve = new SpLib.Com.EveNode(eve);
			m_Agv = agv==null?(new Array):agv;
		}
		
		public function get evename():String
		{
			return m_Eve.m_sEvename;
		}
		
		public function get agv():Array
		{
			return m_Agv;
		}
		
		public override function clone():flash.events.Event
		{
			return new SpLib.Com.SpLibEvent(m_sEveName,m_Eve.m_sEvename,m_Agv);
		}
		
		public override function toString():String
		{
			return formatToString("SpLib.Com.SpLibEvent", "type", "bubbles", "cancelable", "eventPhase", m_Eve.m_sEvename ,"m_Agv");
		}
	}
}